// 引入路由创建实例
import { createRouter, createWebHashHistory } from "vue-router";
import Login from "../components/GeneralUser/LoginAndRegistration/Login.vue";
import ForPwd from "../components/GeneralUser/LoginAndRegistration/ForgetPassword.vue";
import ForumPage from "../components/GeneralUser/Forum/ForumPage.vue";
import ForumIndex from "../components/GeneralUser/Forum/ForumIndex.vue";
import ForumAnswers from "../components/GeneralUser/Forum/ForumAnswers.vue";
import ForumCommunity from "../components/GeneralUser/Forum/ForumCommunity.vue";
import ForumMessage from "../components/GeneralUser/Forum/ForumMessage.vue";
import ForumPost from "../components/GeneralUser/Forum/ForumPost.vue";
import AllPage from "../components/GeneralUser/HomePage/AllPage.vue";
import ForumIntroduction from"../components/GeneralUser/Forum/ForumIntroduction.vue";
import publishArticle from "../components/GeneralUser/Forum/publishArticle.vue";
import publishDynamic from "../components/GeneralUser/Forum/publishDynamic.vue";
import publishQuestion from "../components/GeneralUser/Forum/publishQuestion.vue";
import PersonalCenter from "../components/GeneralUser/Forum/PersonalCenter.vue";
// 李涛
import ConsumerIndex from "../components/part-timeJob/consumer/ConsumerIndex.vue";
import MerchantIndex from "../components/part-timeJob/merchant/MerchantIndex.vue";
import Issue from "../components/part-timeJob/merchant/Issue.vue";

// createRouter 创建路由实例
// createWebHashHistory 创建 hash 路由
const router = createRouter({
    history: createWebHashHistory(),
    // 路由规则
    routes: [
        {
            path: '/', // 根路由
            component: AllPage,//
            children: [
                // 子路由
            ]
        },
        {   
            path:'/ForPwd',
            component:ForPwd
        },
        {
            path:'/Login',
            component:Login
        },
        {
            path:'/ForumPage',
            component:ForumPage,
            // 论坛子页面
            children:[
                {
                    path:'',
                    name:'ForumIndex',
                    component:ForumIndex,
                },
                {
                    path:'/ForumAnswers',
                    name:'ForumAnswers',
                    component:ForumAnswers,
                },
                {
                    path:'/ForumCommunity',
                    name:'ForumCommunity',
                    component:ForumCommunity,
                },
                {
                    path:'/ForumMessage',
                    name:'ForumMessage',
                    component:ForumMessage,
                },
                {
                    path:'/ForumPost',
                    name:'ForumPost',
                    component:ForumPost,
                },
                {
                    path:'/ForumIntroduction',
                    name:'ForumIntroduction',
                    component:ForumIntroduction,
                },
                {
                    path:'/publishArticle',
                    name:'publishArticle',
                    component:publishArticle,
                },
                {
                    path:'/publishDynamic',
                    name:'publishDynamic',
                    component:publishDynamic,
                },
                {
                    path:'/publishQuestion',
                    name:'publishQuestion',
                    component:publishQuestion,
                },
                {
                    path:'/PersonalCenter',
                    name:'PersonalCenter',
                    component:PersonalCenter,
                },
            ]
        },{
            path:'/MerchantIndex',
            component:MerchantIndex,
            children:[
                {
                    path:'/consumerIndex',
                    name:'ConsumerIndex',
                    component:ConsumerIndex
                },
                {
                    path:'/issue',
                    name:'Issue',
                    component:Issue
                }
            ]
        }
        
    ]
});

export default router;